/*
 *	Copyright (C) Ergobyte Informatics S.A. - All Rights Reserved
 *
 * 	This material is proprietary to Ergobyte. The methods and techniques described herein are considered trade secrets
 *	and/or confidential. Reproduction or distribution, in whole or in part, is forbidden except by express written permission.
 */
package com.ergobyte.servo.client;

import org.json.JSONException;
import org.json.JSONObject;

public class UserProfile {

	private String username;
	private String primaryEmail;
	private String firstName;
	private String lastName;

	UserProfile(JSONObject jsonObject) throws JSONException {
		this.username = jsonObject.getString("username");
		this.primaryEmail = jsonObject.getString("primaryEmail");
		this.firstName = jsonObject.getString("firstName");
		this.lastName = jsonObject.getString("lastName");
	}

	public String getUsername() {
		return username;
	}

	public String getPrimaryEmail() {
		return primaryEmail;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	@Override
	public String toString() {
		return String.format("%s[username: %s, primaryEmail: %s, firstName: %s, lastName: %s]",
				getClass().getSimpleName(), username, primaryEmail, firstName, lastName);
	}
}
